<template>
	<view class="flex_ZC">
		<!-- #ifdef H5 -->
		<uNavbar title="支付成功" leftIconColor="#ffffff" > </uNavbar>
		<!-- #endif -->
		
		<view class="pay flex_ZC">
			<image :src="baseUrl +'/static/image/success.png'" mode="aspectFill"></image>
			<text class="f36 c3 fw5">支付成功</text>
		</view>
		<view class="btn_pay flex_ZC">
			<text class="gradient1 f36 c0" @click="lookOrder">查看订单</text>
			<text class="border2 f36 " @click="backHomepage">返回首页</text>
		</view>
		
		<view class="mianmi" v-if="!secreShow" @click="goMianmi">
			<image :src="baseUrl + '/static/image/mianmi.png'" mode="aspectFill"></image>
		</view>
	</view>
</template>

<script>
	import {myuser} from "../../api/user.js"
	export default {
		data() {
			return {
				baseUrl: this.$imageBaseUrl,
				type:"",
				secreShow:0
			}
		},
		onLoad(e) {
			this.type=e.type
			this.userInfo()
		},
		onShow() {
			this.userInfo()
		},
		methods: {
			userInfo() {
				myuser().then(res => {
					console.log('个人信息', res)
					if (res.code == 1) {
						this.secreShow = res.data.secret_free
					}
				})
			},
			// 查看订单
			lookOrder(){
				console.log(11111,this.type);
				if(this.type==1){
					uni.redirectTo({
						url:'/pageOrder/aboutorder/orderlist?id=0'
					})
				}
				if(this.type==2){
					uni.redirectTo({
						url:'/pageOrder/localorder/localorder?id=0'
					})
				}
			},
			goMianmi(){
				uni.navigateTo({
					url:'/pageUser/myuser/secretFree'
				})
			},
			// 返回首页
			backHomepage(){
				uni.switchTab({
					url:'/pages/index/cloudCatIndex'
				})
			}
		},	
	}
</script>

<style scoped>
	.pay{
		width: 750rpx;
		margin-top: 240rpx;
	}
	.pay>image{
		width: 114rpx;
		height: 116rpx;
		margin-bottom: 36rpx;
	}
	.btn_pay{
		margin-top: 200rpx;
	}
	.btn_pay>text{
		width: 386rpx;
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
		border-radius:50rpx;
		margin-top: 30rpx;
	}
	.border2{
		border: 1rpx solid #999999;
	}
	.mianmi{
		margin-top: 180rpx;
	}
	.mianmi>image{
		width: 690rpx;
		height: 138rpx;
	}
</style>